#ifndef __PID_H
#define __PID_H
#include "ti_msp_dl_config.h"

extern uint8_t TaskStep[];


extern float TragetAngle;
extern volatile float pitch,roll,yaw; 
extern uint8_t AngleFlag;
extern float RelativelyAngle;
extern volatile uint8_t TrackLight;	//record track light status
extern volatile uint8_t stopFlag,startFlag;
extern volatile uint8_t BAN;
struct Key{
	unsigned char step;
	unsigned char kCount;
	bool state;
	bool click;
	bool longClick;
};
extern struct Key Keys[3];
enum{
	STOP = 0,
	ANGLE = 1,
	TRACK = 2
};
extern volatile uint8_t Mode;
typedef struct
{
	volatile float ActualValue;   
	float TargetValue;   
	float Err;          
	float Err_last;     
	float Kp,Ki,Kd;   
	float Integral;     
	float OutputValue;   
}Pid;
extern Pid Lpid,Rpid,AnglePid,TrackPid;
extern volatile uint32_t TIMG0Count;
void PID(void);
void PID_Init(void);

#endif
